From ec5a14d7d61d5f1797fcfba67dd2d8ef0cca2360 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 7 Sep 2022 13:58:00 -0700 Subject: image uploads --- src/routes/invoice/[id]/+page.server.js | 3 +-- src/routes/invoice/[id]/+page.svelte | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src/routes/invoice/[id]') diff --git a/src/routes/invoice/[id]/+page.server.js b/src/routes/invoice/[id]/+page.server.js index 5ab0069a..e123c7d7 100644 --- a/src/routes/invoice/[id]/+page.server.js +++ b/src/routes/invoice/[id]/+page.server.js @@ -1,5 +1,4 @@ -import cookie from 'cookie'; -import { get, post } from '$lib/utils'; +import { get } from '$lib/utils'; export async function load({ params }) { let { id } = params; diff --git a/src/routes/invoice/[id]/+page.svelte b/src/routes/invoice/[id]/+page.svelte index e8d5562c..f6ecdc0e 100644 --- a/src/routes/invoice/[id]/+page.svelte +++ b/src/routes/invoice/[id]/+page.svelte @@ -69,9 +69,9 @@ let update = async () => { await tick(); - tip = (tipAmount * 100000000) / rate; + tip = Math.round((tipAmount * 100000000) / rate); let r = await post(`/invoice`, { - amount: amount + tip, + amount: parseInt(amount + tip), rate, tip, text, -- cgit v1.2.3